package com.huawei.virest.common.domain;

import org.apache.commons.configuration.PropertiesConfiguration;

public class Configuration
{
    // context path
    private String contextPath = "";
    
    // 绝对路径
    private String absolutePath = "";
    
    // 自定默认路径
    private String rootDir;
    
    // url值
    private String baseUrl;
    
    // 是否debug
    private String debug;
    
    // Authorization值
    private String authorization;
    
    private String requestSuffix;
    private String responseSuffix;
    
    private String requestRootElement;
    private String responseRootElement;
    
    public Configuration(PropertiesConfiguration properties)
    {
        // 匹配key值
        this.rootDir = properties.getString("rootDir");
        this.baseUrl = properties.getString("baseUrl");
        this.debug = properties.getString("debug");
        this.authorization = properties.getString("Authorization");
        this.requestSuffix = properties.getString("requestSuffix");
        this.responseSuffix = properties.getString("responseSuffix");
        this.requestRootElement = properties.getString("requestRootElement");
        this.responseRootElement = properties.getString("responseRootElement");
    }
    
    public String getBaseUrl()
    {
        return baseUrl;
    }
    
    public void setBaseUrl(String baseUrl)
    {
        this.baseUrl = baseUrl;
    }
    
    public String getContextPath()
    {
        return contextPath;
    }
    
    public void setContextPath(String contextPath)
    {
        this.contextPath = contextPath;
    }
    
    public String getAbsolutePath()
    {
        return absolutePath;
    }
    
    public void setAbsolutePath(String absolutePath)
    {
        this.absolutePath = absolutePath;
    }
    
    public void setRootDir(String rootDir)
    {
        this.rootDir = rootDir;
    }
    
    public String getRootDir()
    {
        return absolutePath + rootDir;
    }
    
    public String getDebug()
    {
        return debug;
    }
    
    public void setDebug(String debug)
    {
        this.debug = debug;
    }
    
    public String getAuthorization()
    {
        return authorization;
    }
    
    public void setAuthorization(String authorization)
    {
        this.authorization = authorization;
    }

	public String getRequestSuffix() {
		return requestSuffix;
	}

	public void setRequestSuffix(String requestSuffix) {
		this.requestSuffix = requestSuffix;
	}

	public String getResponseSuffix() {
		return responseSuffix;
	}

	public void setResponseSuffix(String responseSuffix) {
		this.responseSuffix = responseSuffix;
	}

	public String getRequestRootElement() {
		return requestRootElement;
	}

	public void setRequestRootElement(String requestRootElement) {
		this.requestRootElement = requestRootElement;
	}

	public String getResponseRootElement() {
		return responseRootElement;
	}

	public void setResponseRootElement(String responseRootElement) {
		this.responseRootElement = responseRootElement;
	}
    
    
}
